//创建一个路由器，并暴露出去
import { createRouter, createWebHashHistory } from "vue-router";
import Home from "@/pages/Home.vue";
import Datails from "@/pages/datails.vue";
const routes = [
    {
        path: '/home',
        component: Home
    },
    {
        path: '/news',
        name:"xinwen",
        component: () => import('@/pages/News.vue'),
        children: [
            {
                path: 'datails',
                component: Datails,
                props:true
            }
        ]
    },
    {
        path: '/about',
        component: () => import('@/pages/About.vue')
    },
    {
        path: '/',
        redirect: '/home'
    },
];
const router = createRouter({
    history: createWebHashHistory(),
    routes
});
export default router;